package com.itany.corejava.code07_面向对象;

/**
 * @author: 石小俊
 * @date: 2023年03月06日 14:09
 * @version: 1.0
 */
public class Test01_Person {

    public static void main(String[] args) {
        Person person = new Person();

        // 面向对象
        // 此时所有的属性与方法均必须通过对象来调用
        person.name = "李白";
        person.age = 20;
        person.gender = "男";
        person.hobbies = new String[]{"吃饭","睡觉","打游戏"};
        System.out.println(person.name);
        person.name = "libai";
        person.show();
        person.eat();
        person.sleep();
        person.isAdult();

        // 创建Person类的第二个对象
        // 该对象的具体信息与之前的对象毫无关系
        // 两者都属于Person类
        Person person2 = new Person();
        person2.name = "李四";
        person2.age = 20;
        person2.gender = "女";
        person2.hobbies = new String[]{"看书","学习"};
        person2.show();

    }

}
